package cn.tedu.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController //@Controller + @ResponseBody
@RequestMapping("/hello")
public class HelloController {
    @RequestMapping("/cat")
//    @ResponseBody //让控制器返回的数据能转换成页面能看懂的字符串
    public String hello() {

        return "hello";
    }

    @RequestMapping("/dog")
//    @ResponseBody //让控制器返回的数据能转换成页面能看懂的字符串
    public String hello1() {

        return "hello SpringMvc";
    }


}
